import Vue from 'vue'
import Router from 'vue-router'
import InTheatersComponent from '@/views/m/m-in-theaters'
import MovieDetailComponent from '@/views/m/m-detail'
import ComingSoonComponent from '@/views/m/m-coming-soon'
import Top250Component from '@/views/m/m-top-250'

Vue.use(Router)

const SeriesBooksComponent = { template: '<div>Series Books!</div>' }

export const routes = {
  m: [
    { path: '/', component: InTheatersComponent, name: 'in_theaters', meta: { group: 'm', displayname: '正在热映' } },
    { path: '/m/top250', component: Top250Component, name: 'top250', meta: { group: 'm', displayname: '豆瓣250' } },
    { path: '/m/coming_soon', component: ComingSoonComponent, name: 'comming_soon', meta: { group: 'm', displayname: '即将上映' } },
    { path: '/m/detail/:id', component: MovieDetailComponent, name: 'm_detail', meta: { group: 'm' } }
  ],
  b: [
    { path: '/b/series/:id', component: SeriesBooksComponent, name: 'series', meta: { group: 'b' } }
  ]
}

export const series = [
  { name: '科幻世界·中国科幻基石丛书', id: 38 },
  { name: '世界科幻大师丛书', id: 129 },
  { name: '古典名著普及文库', id: 10185 },
  { name: '阿特伍德文集', id: 33478 },
  { name: '睡魔', id: 34247 }
]

const router = new Router({
  routes: [...routes['m'], ...routes['b']]
})

export default router
